# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/7/6
# @File : arc 108 B - Abbreviate Fox.py

N = int(input())
s = str(input())
char = ""
for i in s:
    char = char + i
    if (char[-3:] == "fox"):
        char = char[:-3]
print(len(char))

#模拟消消乐的场景，遍历每个s中的元素，一个个来，不断消，像消消乐一样。硬解的话会超时的。
"""
硬解（3种）：
N = int(input())
s = str(input())
while("fox" in s):
    s = s.replace("fox","")
print(len(s.replace("fox","")))

N = int(input())
s = str(input())
while(s.find("fox")!= -1):
    s = s.replace("fox","")
print(len(s))

N = int(input())
s = str(input())
while(s.count("fox")>0):
    s = s.replace("fox","")
print(len(s))

"""
